package apiday01.string;

public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "https://www.tedu.cn";
        boolean start = str.startsWith("https://");//判断字符串是否以"https://"开头
        boolean end = str.endsWith(".png");//判断字符串是否以".png"结尾
        System.out.println(start);//true
        System.out.println(end);//false
        boolean start1 = str.startsWith("www",8);////判断字符串第8位开始是否以"www"开头
        System.out.println(start1);
    }
}
